package com.gitee.wsl.coroutines.job.trigger

import com.gitee.wsl.coroutines.job.JobDataMap
import com.gitee.wsl.coroutines.job.JobKey
import com.gitee.wsl.coroutines.job.trigger.ITrigger.EMisfireInstruction
import kotlin.time.ExperimentalTime
import kotlin.time.Instant


@OptIn(ExperimentalTime::class)
interface IMutableTrigger : ITrigger {

    override var key: TriggerKey?

    override var jobKey: JobKey?

    override var description: String?

    override var calendarName: String?

    override var jobDataMap: JobDataMap

    /**
     * The priority of a `Trigger` acts as a tiebreaker such that if
     * two `Trigger`s have the same scheduled fire time, then the one
     * with the higher priority will get first access to a worker thread.<br></br>
     * If not explicitly set, the default value is `5`.
     *
     * @see .DEFAULT_PRIORITY
     */
    override var priority: Int

    /**
     * Get the time at which the `Trigger` should occur.
     *
     * @return The start. May be `null` depending on the implementation
     */
    override var startTime: Instant?

    override var endTime: Instant?

    /**
     * Get the instruction the `Scheduler` should be given for handling
     * misfire situations for this `Trigger`- the concrete
     * `Trigger` type that you are using will have defined a set of
     * additional `MISFIRE_INSTRUCTION_XXX` constants that may be set
     * as this property's value.
     *
     *
     * If not explicitly set, the default value is
     * `MISFIRE_INSTRUCTION_SMART_POLICY`.
     *
     *
     * @see ISimpleTrigger
     *
     * @see ICronTrigger
     */
    override var misfireInstruction: EMisfireInstruction?

    override var nextFireTime: Instant?

    override var previousFireTime: Instant?

}
